std::time

From Cppreference

< cpp | chrono | c
Jump to: navigation, search
Defined in header <ctime>

time_t time( time_t *time );

Gets the time since epoch as a time_t object.

Contents

Parameters

time - pointer to a time_t object to store the time in. If NULL is passed instead, internal static object is used

Return value

time since epoch as a time_t object on success, -1 on error.

Example

See also

localtime
converts time since epoch to calendar time expressed as local time
(function)
gmtime
converts time since epoch to calendar time expressed as Universal Coordinated Time
(function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages